package gerenciaDados.cln.cgt.PI.preProcessamento;

import java.awt.Color;
import java.awt.image.BufferedImage;


public class ModelodeCores {
	public static void RGBtoHSV(BufferedImage img, float [] hsv){
		int largura = img.getWidth();
		int altura = img.getHeight();		
		Color c;
		int N = altura*largura;			
		float [] aux = new float[3];
		
		int [] pixels = img.getRGB(0, 0, largura, altura, null, 0, largura);		
		for(int i=0; i<N; i++){
			c = new Color(pixels[i]);			
			Color.RGBtoHSB( c.getRed() , c.getGreen(), c.getBlue(), aux);
			hsv[i] = aux[2];
		}				
	}
}
